package com.SunSoft.PhoneRemoteControl;

import android.app.AlertDialog.Builder;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.message.BasicNameValuePair;

final class cm
  implements View.OnClickListener
{
  public final void onClick(View paramView)
  {
    paramView = this.a.getResources().getResourceName(paramView.getId());
    int i = Integer.parseInt(paramView.substring(paramView.length() - 1));
    MainControl.a("Test", "but_id:" + String.valueOf(i));
    if (!(this.a.aZ))
    {
      paramView = MainControl.d(this.a).a("save_user");
      Object localObject1 = MainControl.d(this.a).a("save_pass");
      MainControl.a("Test", "save_user:" + paramView);
      MainControl.a("Test", "save_pass:" + ((String)localObject1));
      switch (i)
      {
      default:
      case 2:
      case 3:
      case 4:
      case 5:
      case 0:
      case 1:
      }
      do
      {
        do
        {
          return;
          this.a.h();
          return;
          this.a.g();
          return;
          paramView = this.a;
          localObject1 = LayoutInflater.from(paramView).inflate(2130903082, null);
          Object localObject2 = (TextView)((View)localObject1).findViewById(2131165355);
          TextView localTextView1 = (TextView)((View)localObject1).findViewById(2131165446);
          TextView localTextView2 = (TextView)((View)localObject1).findViewById(2131165357);
          TextView localTextView3 = (TextView)((View)localObject1).findViewById(2131165245);
          AlertDialog.Builder localBuilder = new AlertDialog.Builder(paramView);
          localBuilder.setView((View)localObject1);
          localBuilder.setTitle(paramView.aj + paramView.getString(2131099758));
          localBuilder.setPositiveButton(paramView.getString(2131099651), new bn(paramView, (TextView)localObject2, localTextView1, localTextView2, localTextView3));
          localBuilder.setNegativeButton(paramView.getString(2131099654), new bo(paramView));
          paramView.aT = localBuilder.show();
          return;
          MainControl.d(this.a).a("save_pass", "");
          this.a.a(4);
          Toast.makeText(this.a, this.a.getString(2131099773), 0).show();
          return;
          localObject2 = MainControl.i(this.a).rawQuery("select ID,control_type,name_ch,name_en,brand_ch,brand_en  from control_list where ID > ? and come_from<>? order by come_from desc,ID desc", new String[] { "0", "9" });
          this.a.bm = ((Cursor)localObject2).getCount();
          if (this.a.bm == 0)
          {
            Toast.makeText(this.a, this.a.getString(2131099774), 0).show();
            return;
          }
          if (this.a.bm <= 30)
            continue;
          this.a.bm = 30;
        }
        while ((paramView.length() <= 1) || (((String)localObject1).length() <= 1));
        this.a.an = new ArrayList();
        this.a.an.add(new BasicNameValuePair("txtUser_name", paramView));
        this.a.an.add(new BasicNameValuePair("txtPassword", (String)localObject1));
        this.a.an.add(new BasicNameValuePair("action_value", "check"));
        this.a.bj = 14;
        this.a.ba = 13;
        this.a.bb = "http://www.tasogo.com/user_control.aspx";
        paramView = new Message();
        paramView.what = 5;
        this.a.ca.sendMessage(paramView);
        this.a.aZ = true;
        return;
      }
      while ((paramView.length() <= 1) || (((String)localObject1).length() <= 1));
      this.a.an = new ArrayList();
      this.a.an.add(new BasicNameValuePair("txtUser_name", paramView));
      this.a.an.add(new BasicNameValuePair("txtPassword", (String)localObject1));
      if (MainControl.d)
        this.a.an.add(new BasicNameValuePair("action_value", "list"));
      while (true)
      {
        this.a.bj = 15;
        this.a.ba = 13;
        this.a.bb = "http://www.tasogo.com/user_control.aspx";
        paramView = new Message();
        paramView.what = 5;
        this.a.ca.sendMessage(paramView);
        this.a.aZ = true;
        return;
        this.a.an.add(new BasicNameValuePair("action_value", "check"));
      }
    }
    Toast.makeText(this.a, this.a.getString(2131099768), 0).show();
  }
}